package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserLocationPicture;
import com.culturalCenter.dataCenter.mapper.user.UserLocationPictureMapper;
import com.culturalCenter.dataCenter.service.user.UserLocationPictureService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserLocationPicture业务层接口实现类
 * @Date
 *****/
@Service
public class UserLocationPictureServiceImpl implements UserLocationPictureService {

    @Resource
    private UserLocationPictureMapper userLocationPictureMapper;

    @Override
    public PageInfo<UserLocationPicture> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userLocationPictureMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userLocationPictureMapper.deleteById(id);
    }

    @Override
    public Integer update(UserLocationPicture userLocationPicture) {
        return userLocationPictureMapper.update(userLocationPicture);
    }

    @Override
    public Integer add(UserLocationPicture userLocationPicture) {
        return userLocationPictureMapper.insert(userLocationPicture);
    }

    @Override
    public UserLocationPicture findById(String id) {
        return userLocationPictureMapper.queryById(id);
    }

    @Override
    public List<UserLocationPicture> findAll(UserLocationPicture userLocationPicture) {
        return (List<UserLocationPicture>) userLocationPictureMapper.queryAll(userLocationPicture);
    }

}
